<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../node_modules/vue/dist/vue.js"></script>
</head>
<body>
    <div id="aa">
        旧密码：<input v-model="num"><br>
        新密码：<input v-model="nun">
    </div>
</body>
    <script type="text/javascript">
        new Vue({
            el:"#aa",
            data: {
                num:null,
                nun:null
            },
            watch: {
                nun(newValue, oldValue) {
                    if (this.num === newValue) {
                        console.log("两次密码相同！")
                    } else {
                        console.log("两次密码不相同！")
                    }
                }
            }
        })
    </script>
</html>